Skip to content

Feature/add pydantic models for 3d api#27

Merged
javlor merged 10 commits into
mainfrom
feature/add-pydantic-models-for-3d-api
Jul 17, 2026
Merged

Feature/add pydantic models for 3d api#27
javlor merged 10 commits into
mainfrom
feature/add-pydantic-models-for-3d-api

Conversation

@javlor

@javlor javlor commented May 20, 2026

Copy link
Copy Markdown
Collaborator

Adding several data models related to 3D API calls that were not available in the PV plant object of the energy calculation inputs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the SolarFarmer SDK’s Pydantic model layer to cover additional 3D API payload structures (geometry, terrain, trackers/racks, and 3D inverter wiring) that were previously not represented under PVPlant / energy calculation inputs.

Changes:

  • Add new 3D geometry and scene models (vectors/quads, racks/trackers, shading objects, and simple terrain DTOs).
  • Add 3D inverter wiring models (InverterInput, ModuleString, ModuleIndexRange) and update Inverter/PVPlant to reference them.
  • Add composition/serialization tests validating camelCase + ...ID alias behavior for 3D payloads.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_models/test_composition.py Adds serialization + JSON round-trip coverage for new 3D models and PVPlant composition.
solarfarmer/models/vector3double.py Introduces a 3D vector/point model used across 3D geometry DTOs.
solarfarmer/models/quad_double.py Adds a 4-point quad model for rack geometry.
solarfarmer/models/rack.py Adds 3D fixed-tilt rack model with mountingTypeID aliasing.
solarfarmer/models/racks.py Adds a wrapper collection model for racks.
solarfarmer/models/tracker.py Adds 3D tracker model with explicit ...ID aliases.
solarfarmer/models/trackers.py Adds a wrapper collection model for trackers.
solarfarmer/models/indexed_object3d.py Adds indexed mesh representation for 3D shading obstacles.
solarfarmer/models/shading_objects.py Adds a collection model for shading objects (see API-shape comment).
solarfarmer/models/terrain_row_start_end_columns_dto.py Adds DTO for active column spans in a terrain row.
solarfarmer/models/terrain_row_dto.py Adds DTO for a terrain row made of column-span segments.
solarfarmer/models/mini_simple_terrain_dto.py Adds DTO for terrain tiles (grid dimensions, vertices, row spans).
solarfarmer/models/simple_terrain.py Adds container model for tiled “simple terrain” representation.
solarfarmer/models/module_index_range.py Adds rack/tracker module indexing DTO with explicit mountingID alias.
solarfarmer/models/module_string.py Adds module string DTO composed of module index ranges.
solarfarmer/models/inverter_input.py Adds 3D inverter MPPT input wiring + losses + optimizer fields.
solarfarmer/models/inverter.py Types inverter_inputs as list[InverterInput] for 3D wiring support.
solarfarmer/models/pv_plant.py Extends PVPlant with 3D fields (racks/trackers/terrain/shading + specs dicts).
solarfarmer/models/enums.py Adds PowerOptimizerOperationType enum for 3D optimizer configuration.
solarfarmer/models/init.py Re-exports newly added models/enums for solarfarmer.models users.
solarfarmer/init.py Re-exports newly added models/enums at top-level package API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread solarfarmer/models/inverter_input.py Outdated
Comment thread solarfarmer/models/inverter_input.py
Comment thread solarfarmer/models/inverter_input.py Outdated
Comment thread solarfarmer/models/shading_objects.py
javlor and others added 4 commits July 17, 2026 13:22
Remove unnecessary info for docstring of dc_ohmic_connector_loss

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ss parameters are mutually exclusive (resistance takes precedence).
@javlor
javlor merged commit 9138ab4 into main Jul 17, 2026
14 checks passed
@javlor
javlor deleted the feature/add-pydantic-models-for-3d-api branch July 17, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants